home *** CD-ROM | disk | FTP | other *** search
- Path: news.den.mmc.com!usenet
- From: Steve Howard <howard@mtm.syr.ge.com>
- Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
- Subject: Re: C/C++ knocks the crap out of Ada
- Date: Mon, 04 Mar 1996 14:29:50 -0500
- Organization: Lockheed Martin Ocean, Radar & Sensor Systems - Syracuse
- Message-ID: <313B44AE.4134@mtm.syr.ge.com>
- References: <JSA.96Feb16135027@organon.com> <SPENCER.96Feb29102241@zorgon.ERA.COM> <4h5bptINN9oi@anvil.ugrad.cs.ubc.ca> <4hakfl$ogd@fred.netinfo.com.au> <4hf701INNdl7@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: 144.219.108.219
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Kazimir Kylheku wrote:
- >
-
- > Ada compiled code will catch this? My ass. The hardware is supposed to catch
- > this, by implementing _at the very least_ a parity bit for detecting single-bit
- > alterations in dynamic RAM. For more robust reliability, you want more bits
- > than that so that you can implement Hamming code error correction and
- > detection.
- >
- > What if the toggled bit is in the middle of an integer or a floating point
- > number's sign, mantissa or exponent such that the alteration results in a
- > perfectly valid number?
- >
-
- No, Ada probably won't detect this error.....
-
- >
- > How do you know that? Most of the kinds of things you describe (e.g. range
- > checking) can be handled by a specialized compiler.
- > --
-
- They probably _can_ be handled by a specialized C compiler.... but they _will_ be handled
- by _every_ Ada compiler. Can I get that from Visual C++? I thought not....
-
-
- Of course, one fundamental distinction is that Ada code generally avoids using "pointers", and
- therefore is less prone to problems associated with them, while C code uses pointers almost
- exclusively. Therefore, the errors mentioned would typically cause data values to be "changed" in Ada,
- rather than changing pointers and accessing invalid memory in C.
-
- It is true that no code should be developed with the assumption that the compiler/run-time will
- prevent errors. Experience is always needed to prevent bugs. However, even the best, most experienced,
- engineers make mistakes (Kazimir excluded, of course ;) ) Ada compilers and the supporting run-time
- systems help to identify these problems early on.
-
- --
- E. Steve Howard | Lockheed Martin
- | Ocean, Radar, & Sensor Systems
- mailto:howard@mtm.syr.ge.com | Syracuse, NY
-